module WindSpirit
{
    export class ShareTipLayer extends WindSpirit.MarskLayer
    {
        public shareTip: egret.Bitmap;
        public shareTipLabel: egret.TextField;
        public constructor()
        {
            super();
            var shareTip = new egret.Bitmap(RES.getRes("share_tip_png"));
            shareTip.anchorX = 1;
            shareTip.x = WindSpirit.Util.stageW;
            this.shareTip = shareTip;
            this.addChild(this.shareTip);

            var shareTipLabel = new egret.TextField;
            shareTipLabel.size = 0.104*WindSpirit.Util.stageW;
            shareTipLabel.anchorX = shareTipLabel.anchorY = 0.5;
            shareTipLabel.x = WindSpirit.Util.centerX;
            shareTipLabel.y = WindSpirit.Util.centerY;
            shareTipLabel.text = "请点击右上角\n点击[分享到朋友圈]";
            shareTipLabel.textAlign = egret.HorizontalAlign.CENTER;
            this.shareTipLabel = shareTipLabel;
            this.addChild(shareTipLabel);
            this.touchEnabled = true;
            this.addEventListener(egret.TouchEvent.TOUCH_TAP,this.touch,this);
        }
        public touch(e:egret.TouchEvent)
        {
            if(this.parent)
            {
                this.parent.removeChild(this);
            }
            e.stopPropagation();
        }
    }
}